<script>
  export default {
    // 在页面中定义插屏广告
    globalData: {
      playIndex: 0, //当前播放列表的index
      currentTime: 0, //当前播放时间
      duration: 0, //总时长
    },
    onLaunch: function() {
      const updateManager = uni.getUpdateManager()
      updateManager.onCheckForUpdate(function(res) {
        // 请求完新版本信息的回调
        // console.log(res.hasUpdate)
      });
      updateManager.onUpdateReady(function() {
        uni.showModal({
          title: '更新提示',
          content: '新版本已经准备好，是否重启应用？',
          success: function(res) {
            if (res.confirm) {
              // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
              updateManager.applyUpdate()
            }
          }
        })
      });
      updateManager.onUpdateFailed(function() {
        // 新版本下载失败
      })
    },
    onShow: function() {

    },
    onHide: function() {
      console.log('App Hide')
    }
  }
</script>

<style>
  page {
    background-image:
      radial-gradient(closest-side, rgb(232, 49, 13), rgba(235, 105, 78, 0)),
      radial-gradient(closest-side, rgb(11, 243, 197), rgba(243, 11, 164, 0)),
      radial-gradient(closest-side, rgb(64, 145, 14), rgba(254, 234, 131, 0)),
      radial-gradient(closest-side, rgb(234, 135, 7), rgba(170, 142, 245, 0));
    background-size: 130vw 130vh, 120vw 120vh, 100vw 150vh, 120vw 130vh;
    background-position: -80vw -80vh, 30vw -20vh, -20vw 20vh, 30vw 20vh;
    background-repeat: no-repeat;
  }

  page,
  view,
  text,
  navigator,
  input,
  textarea,
  form {
    box-sizing: border-box;
  }

  .content {
    position: relative;
    flex: 1;
    z-index: 3;
    margin-top: 20rpx;
  }

  .scroll-bar {
    height: 100%;
  }

  .wrap {
    padding-left: 30rpx;
    padding-right: 30rpx;
  }

  .flex-bar {
    display: flex;
    flex-flow: row;
  }

  .flex-wrap {
    flex-wrap: wrap;
  }

  .item-img {
    margin: -20rpx -10rpx 0 -10rpx;
  }

  .item-img .img {
    width: 100%;
    height: 600rpx;
    border-radius: 8rpx;
  }

  .item-img>view {
    margin-top: 20rpx;
    padding: 0 10rpx;
  }

  .col-6 {
    width: 50%;
  }

  .opacity:active,
  .link:active {
    opacity: .7;
  }
</style>
